package com.study.a02threadDemo2;

public class ThreadDemo {
    public static void main(String[] args) {

        //定义一个类实现Runnable接口
        //重写run方法

        //创建myrun对象
        //表示多线程要执行的任务
        MyRun myrun = new MyRun();

        Thread T1 = new Thread(myrun);

        Thread T2 = new Thread(myrun);

        T1.setName("线程1");

        T2.setName("线程2");

        T1.start();
        T2.start();
    }
}
